﻿using PluginForCertHandOut;
using QiNiuCertHandOut;
using Service;
using Service.Utity;
using System.Security.Cryptography;
using System.Text;

namespace Plugin.Test
{
    [TestClass]
    public class UnitTest_Service
    {
        [TestMethod]
        public void Test_PluginFactory()
        {
            var dnsRecordEditores = PluginFactory.CreateDNSRecordEditorInstance();
            var certHandOuts = PluginFactory.CreateCertHandOutInstance();
            var identity = certHandOuts[0].Config;
            Assert.IsNotNull(dnsRecordEditores.Count > 0);
        }
        [TestMethod]
        public void Test_AutomaticConfig()
        {
        }
        /// <summary>
        /// 混合加密
        /// </summary>
        [TestMethod]
        public void Test_StringOption()
        {
            RSA rSA = RSA.Create();
            string s = $@"123";
            var res = StringOption.Encrypt(s, rSA);
            var d = StringOption.Decrypt(res, rSA);
            Assert.AreEqual(d, s);
        }
    }
}
